import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.tree.*;


public class Time_Sett extends JInternalFrame implements InterInterface
{
	public int time_of_Exam = 0;
	public Time_Sett()
	{
		super("Time Setting For The Examination",false,true,false,false);
		
		
	}
	public void Time_Sett1()
	{
		this.setBounds(60,60,400,200);
		setVisible(true);
		
		Container c = getContentPane();
		c.setLayout(null);
		
		lab10.setBounds(0,20,400,25);
		c.add(lab10);
		lab10.setFont(new Font("Verdana",Font.PLAIN,12));
		
		taf1.setBounds(40,50,100,20);
		c.add(taf1);
		
		lab11.setBounds(145,50,90,25);
		lab11.setFont(new Font("Verdana",Font.PLAIN,12));
		c.add(lab11);
		
		bt16.setBounds(60,100,80,35);
		c.add(bt16);
		bt17.setBounds(160,100,80,35);
		c.add(bt17);
		bt18.setBounds(260,100,80,35);
		c.add(bt18);
		
		bt16.addActionListener(new ActionListener()
		{
		public void actionPerformed(ActionEvent e)
		{
			ApplyTime();
		}
		}
		);
		bt17.addActionListener(new ActionListener()
		{
		public void actionPerformed(ActionEvent e)
		{
			OkButt();
		}
		}
		);
		bt18.addActionListener(new ActionListener()
		{
		public void actionPerformed(ActionEvent e)
		{
			CancelButt();
		}
		}
		);
		
		try
		{
			UIManager.setLookAndFeel(looks[1].getClassName());
			SwingUtilities.updateComponentTreeUI(this);
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
	}
	private void ApplyTime()
	{
		 try {
		taf4.setText(Integer.toString(Integer.parseInt(taf1.getText())));
	}
	catch(Exception ex)
	{
		JOptionPane.showMessageDialog(null,"Invalid Time Setting!!!","Error",JOptionPane.ERROR_MESSAGE);
	}
	
	}
	private void OkButt()
	{
		try {
		taf4.setText(Integer.toString(Integer.parseInt(taf1.getText())));
	}
	catch(Exception ex)
	{
		JOptionPane.showMessageDialog(null,"Invalid Time Setting!!!","Error",JOptionPane.ERROR_MESSAGE);
	}
		this.dispose();
	}
	private void CancelButt()
	{
		taf1.setText("");
		this.dispose();
	}
	
	
}
